/*
 * Copyright (c) 2021, CDB. All rights reserved.
 * JDK1.8
 */
/**
 * @desc    流程实例信息，包括流程定义、当前节点、已完成节点
 * @project 巡视与党风廉政建设系统
 * @company 北京远桥科技有限公司
 * @author  wanglei
 * @version 1.0
 * @date    2021-04-26
 */
package com.dick.base.dto;

import lombok.Data;

import java.util.LinkedList;
import java.util.List;

@Data
public class ProcessInstanceInfo {

    /**
     * 流程定义-节点列表
     */
    private List<Node> definitionNodes = new LinkedList<>();
    /**
     * 流程定义-连接线列表
     */
    private List<Sequence> definitionSequences = new LinkedList<>();
    /**
     * 流程实例-当前任务节点id
     */
    private List<String> instanceActiveNodes = new LinkedList<>();
    /**
     * 流程实例-已完成节点id
     */
    private List<String> instanceHistoricNodes = new LinkedList<>();
    /**
     * 流程实例-已完成连接线id
     */
    private List<String> instanceHistoricSequences = new LinkedList<>();

    /**
     * <strong>流程节点</strong>
     * @see org.flowable.bpmn.model.FlowNode
     * @see org.flowable.bpmn.model.Task
     * @see org.flowable.bpmn.model.Event
     * @see org.flowable.bpmn.model.Gateway
     */
    @Data
    public static class Node {
        /**
         * 节点标识
         * @see org.flowable.bpmn.model.FlowNode#getId()
         * */
        private String id;
        /**
         * 节点名称
         * @see org.flowable.bpmn.model.FlowNode#getName()
         * */
        private String name;
    }

    /**
     * <strong>流程连接线</strong>
     * @see org.flowable.bpmn.model.SequenceFlow
     */
    @Data
    public static class Sequence {
        /**
         * 标识
         * @see org.flowable.bpmn.model.SequenceFlow#getId()
         * */
        private String id;
        /**
         * 名称
         * @see org.flowable.bpmn.model.SequenceFlow#getName()
         * */
        private String name;
        /**
         * 起点
         * @see org.flowable.bpmn.model.SequenceFlow#getSourceRef()
         * @see Node#id
         */
        private String sourceRef;
        /**
         * 终点
         * @see org.flowable.bpmn.model.SequenceFlow#getTargetRef()
         * @see Node#id
         */
        private String targetRef;
    }
}
